package com.aiwu.pop;

import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AlertDialog;

import org.citra.citra_emu.R;
import org.citra.citra_emu.activities.EmulationActivity;

public class AmiiboDialog extends AlertDialog implements View.OnClickListener {
    private EmulationActivity activity;
    private FastSettingDialog fastSettingDialog;

    public AmiiboDialog(EmulationActivity context,FastSettingDialog fastSettingDialog) {
        super(context, R.style.AiWuDialog);
        this.activity = context;
        this.fastSettingDialog = fastSettingDialog;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
    }

    private void init() {
        setContentView(R.layout.dialog_amiibo);
        setCancelable(true);
        setCanceledOnTouchOutside(true);
        findViewById(R.id.layout_load).setOnClickListener(this);
        findViewById(R.id.layout_remove).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.layout_load:
                activity.ChooseAmiibo();
                break;
            case R.id.layout_remove:
                activity.RemoveAmiibo();
                break;
        }
        dismiss();
        fastSettingDialog.dismiss();
    }
}
